//index.js
//获取应用实例
const app = getApp();
const indexHttp=require('../../modules/indexHttp');
Page({
  data: {
    djs:[]
  },
  async onLoad(){
    var res=await indexHttp.getIndexData();
    console.log(res)
    var data=res.data.programs;
    var djs=[]
    data.forEach(item => {
      var obj={};
      obj.id=item.id;
      obj.name=item.mainSong.name;
      obj.pic=item.coverUrl;
      obj.author=item.mainSong.artists[0].name;
      djs.push(obj);
    });
    this.setData({
      djs
    })
  }
})
